home *** CD-ROM | disk | FTP | other *** search
/ The Ultimate Human Body 2.0 / Ultimate Human Body 2.0, The (1996)(Dorling Kindersley).iso / dksetup / dkgen.inc < prev    next >
Text File  |  1996-09-24  |  38KB  |  962 lines

  1. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. '
  3. '   DKGEN.INC
  4. '
  5. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. ' See the change history in DKSETUP.MST for more recent changes.
  7. '
  8. '25/06/96 Added the extra ini settinigs into the InstallQTW function.
  9. '27/02/96 Added the InstallQTW function.
  10. '25/01/96 Change the EndCommonInstall and HandleRestart SUB's to Functions to
  11. '         utilise return values. So the user does NOT get the 'You must restart
  12. '         windows' warning AND THEN the 'Successful install' dialog box.
  13. '25/01/96 Change path checking to look for Max of 8 chars first.
  14. '08/08/95 Test for Norton Anti Virus
  15. '03/08/95 const for uninstall and min register added
  16. '07/07/95 Correct so unregisters use of ctl3d
  17. '01/06/95 No choice about adding icons to progman
  18. '?/05/95  If bundle with sampler need to test for cirrus driver - put into mst file
  19. '12/03/95 Alternative function added, readme icon has shortened name
  20.  
  21. '$INCLUDE 'setupapi.inc'
  22. '$INCLUDE 'msdetect.inc'
  23. '$INCLUDE 'dklang.inc'
  24.  
  25. '   Defines unlikely to change
  26. CONST APPLICATION_MENU_FILE     = "custmenu.exe"
  27. CONST INI_FILE_SOURCE = "AppPath" ' OR  "WinPath"
  28. CONST EDITOR_EXE        = "write.exe "
  29. CONST SAMPLER_PATH      = "SAMPLER"
  30. CONST SAMPLER_EXE_FILE  = "sampler.exe"
  31. CONST SAMPLER_INI_FILE  = "sampler.ini"
  32. CONST SAMPLER_BINARIES_SECTION_NAME = "SAMPBIN"
  33. CONST SAMPLER_README_FILE = "SREADME.WRI"
  34.  
  35. CONST SOURCE_BINARIES_SUBDIR = "DKCODE"
  36. CONST SOURCE_SETUP_SUBDIR = "DKSETUP"
  37. CONST SETUP_INF_FILENAME = "SETUP.INF"
  38. CONST CUIDLL_FILENAME = "mscuistf.dll"
  39. CONST SETUP_INI_BINARIES_SECTION_NAME = "BIN"
  40. CONST SETUP_INI_SH_BINARIES_SECTION_NAME = "BIN Shared"
  41. CONST SETUP_INI_WING_BINARIES_NAME = "WinG Runtime"
  42. CONST SETUP_INI_WING32_BINARIES_NAME = "WinG32"
  43. CONST SETUP_INI_ACM_SECTION_NAME = "ACM Drivers"
  44. CONST SETUP_INI_FONTS_SECTION_NAME = "Fonts"
  45.  
  46. 'unin, min register
  47. CONST UNINSTALL_EXE_FILE = "UNINSTAL.exe"
  48. CONST DKREG_INI_DIR = "\MMAPP"
  49. CONST DKREG_INI_PATH = "\MMAPP\MMAPP.ini"
  50. CONST WIN_INI_ENTRY = "path"
  51.  
  52. CONST PRODUCT_INI_DIR_SECTION_NAME = "Directory"
  53. CONST PRODUCT_INI_DIR_ENTRY_NAME = "Data"
  54.  
  55. CONST MINIMUM_DISK_SPACE = 2048 ' For Minimum install
  56.  
  57. ' Procs
  58. CONST PROC_HELP = "FHelpDlgProc"
  59.  
  60. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (szEXE$, szParams$) AS INTEGER
  61. DECLARE FUNCTION GetActiveWindow    lib "User" () as integer
  62. DECLARE FUNCTION GetParent    lib "User" (hwnd as integer) as integer
  63. DECLARE FUNCTION IsWindow    lib "User" (hwnd as integer) as integer
  64. DECLARE FUNCTION ShowWindow    lib "User" (hwnd as integer,style as integer) as integer
  65. DECLARE FUNCTION SetWindowPos       lib "User" (hwnd as integer, hwnd as integer, i as integer, i as integer, i as integer, i as integer, w as integer) as integer
  66. DECLARE FUNCTION SetActiveWindow       lib "User" (hwnd as integer) as integer
  67.  
  68. DECLARE FUNCTION Ctl3dRegister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  69. DECLARE FUNCTION Ctl3dUnregister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  70. DECLARE FUNCTION Ctl3dAutoSubClass LIB "CTL3D.DLL" (hInst%) AS INTEGER
  71.  
  72. DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
  73. DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
  74. DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
  75. DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
  76. DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
  77. DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
  78.  
  79. DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER
  80. DECLARE FUNCTION FIs256Colour LIB "colors.dll" AS INTEGER
  81. DECLARE FUNCTION Welcome() AS INTEGER
  82. DECLARE FUNCTION TestSystem() AS INTEGER
  83. DECLARE FUNCTION GetDiskSpaceNeeded(drive%) AS LONG
  84. DECLARE SUB Initialise(prodName$, defInstallPath$, msgCaption$)
  85. DECLARE SUB DeInitialise()
  86. DECLARE SUB AskQuit()
  87. DECLARE SUB BadPath()
  88. DECLARE SUB NetworkDrive()
  89. DECLARE SUB UpdateIndeoAVIDrivers()
  90. DECLARE SUB UpdateWinGDrivers()
  91. 'DECLARE SUB UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  92. 'DECLARE SUB UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  93. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  94. DECLARE FUNCTION GetRealWindowsSysDir AS STRING
  95. DECLARE SUB UpdateWinG32 (szOrig$)
  96. DECLARE SUB InitCommonInstall()
  97. DECLARE FUNCTION LicenseAgreement() AS INTEGER
  98. DECLARE FUNCTION Win32sRequiredDLG() AS INTEGER
  99. DECLARE FUNCTION UpdateADPCMDrivers() AS INTEGER
  100. DECLARE FUNCTION EndCommonInstall( AppReadmeFile$, InRoot%, szEditorExe$ ) AS INTEGER
  101. DECLARE FUNCTION HandleRestart() AS INTEGER
  102. DECLARE FUNCTION InstallQTW() As Integer
  103. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  104.  
  105. '  SetWindowPos() flags
  106. const SWP_NOSIZE         = &H0001
  107. const SWP_NOMOVE         = &H0002
  108. const SWP_NOACTIVATE     = &H0010
  109. const SWP_SHOWWINDOW     = &H0040
  110. const SWP_HIDEWINDOW     = &H0080
  111. const HWND_TOP       = (0)
  112. const HWND_BOTTOM    = (1)
  113. const HWND_TOPMOST   = (-1)
  114. const HWND_NOTOPMOST = (-2)
  115.  
  116.  
  117. 'Dialog Box ID's
  118. CONST DLG_ABORT                       =100
  119. CONST DLG_ADDSYSTEMSOFT               =101
  120. CONST DLG_ADPCMHELP                   =102
  121. CONST DLG_AWFULMACHINE                =103
  122. CONST DLG_BADEXIT                     =110
  123. CONST DLG_BADVGA                      =111
  124. CONST DLG_BADPATH                     =112
  125. CONST DLG_BILLBOARD                   =113
  126. CONST DLG_CUSTOM                      =120
  127. CONST DLG_CUSTOMHELP                  =121
  128. CONST DLG_DESTPATH                    =130
  129. CONST DLG_DEVELOPER                     =133
  130. CONST DLG_DONEVIDEO                   =131
  131. CONST DLG_DONENOVIDEO                 =132
  132. CONST DLG_EXITFAILNOTENH              =140
  133. CONST DLG_EXITFAILNOTINTEL            =141
  134. CONST DLG_EXITFAILNOTWIN31            =142
  135. CONST DLG_EXITFAILRUNAPP              =143
  136. CONST DLG_FREECELLINST                =150
  137. CONST DLG_INSTALLQTW                  =180
  138. CONST DLG_LICENSE                     =210
  139. CONST DLG_MAILMAN                     =220
  140. CONST DLG_NOSPACE                     =230
  141. CONST DLG_NEEDS31                     =231
  142. CONST DLG_NOMOUSE                     =232
  143. CONST DLG_NOT256                      =233
  144. CONST DLG_NOSYSSOFT                   =234
  145. CONST DLG_NODISKSPACE                 =235
  146. CONST DLG_NEEDSWIN32S                 =236
  147. CONST DLG_NETWORKDRIVE                =237
  148. CONST DLG_PATHHELP                    =240
  149. CONST DLG_POORMACHINE                 =241
  150. CONST DLG_PROGMANGROUP                =242
  151. CONST DLG_PROGMANGRP                  =243
  152. CONST DLG_QUIT                        =250
  153. CONST DLG_SPEED                       =270
  154. CONST DLG_SUCCESS                     =271
  155. CONST DLG_URKADPCM                    =290
  156. CONST DLG_WELCOME                     =310
  157. CONST DLG_WELHELP                     =311
  158. CONST DLG_WRONGADPCM                  =312
  159. CONST DLG_WHIZZHELP                   =313
  160. 'Bitmap ID
  161. CONST IDB_BITMAP                      =1000
  162.  
  163. ' Error messages
  164. CONST ERR_OK = 100
  165. CONST ERR_EXITFAIL = 101
  166. CONST ERR_WINVERFAIL = 102
  167. CONST ERR_NODISKSPACE = 103
  168.  
  169. ' Navigation messages
  170. CONST NAV_FORWARD = 0
  171. CONST NAV_BACK = 1
  172. CONST NAV_EXIT = 2
  173. CONST NAV_RUN = 3
  174.  
  175.  
  176. GLOBAL szDirectCommand As String
  177. GLOBAL szWinPath As String
  178. GLOBAL szWinSysPath As String
  179. GLOBAL szWinDrive As String
  180. GLOBAL szSrcSetupPath As String
  181. GLOBAL szSrcBinPath As String
  182. GLOBAL szDestPath As String
  183. GLOBAL szOldDestPath As String
  184. GLOBAL szPengePath As String
  185. GLOBAL szINFPath As String
  186. GLOBAL szAppINIPath As String
  187. GLOBAL szMsgCaption As String
  188. GLOBAL szButton As String
  189. GLOBAL szMinimalInstall As String
  190. GLOBAL szAddPMItem As String
  191. GLOBAL szExpressCustomChoice As String
  192. GLOBAL szMMappPath As String
  193. GLOBAL szInstExePath As String
  194. GLOBAL szInstExeDate As String
  195. GLOBAL szCdExePath As String
  196. GLOBAL szCdExeDate As String
  197. GLOBAL szCopyright As String
  198. GLOBAL szFullSampPath As String
  199. GLOBAL szSampINIPath As String
  200. GLOBAL szSampData As String
  201. GLOBAL szSampVersion As String
  202. GLOBAL szMsacmPriority1 As String
  203. GLOBAL szMsacmPriority2 As String
  204. GLOBAL szMsacmPriority3 As String
  205. GLOBAL bInstalledWin32s As Integer
  206. GLOBAL APPLICATION_INI_FILE As String
  207. GLOBAL APPLICATION_EXE_FILE As String
  208. GLOBAL APPLICATION_PENGE_FILE As String
  209. GLOBAL szDKRegIni As String ' MMAPP.INI
  210.  
  211. GLOBAL fPreviousMode As Integer
  212. GLOBAL fWillNotFit As Integer
  213. GLOBAL fSystemUpdated As Integer
  214. GLOBAL hDlg As Integer
  215. GLOBAL dButton As Integer
  216. GLOBAL dWinDrive As Integer
  217. GLOBAL dDestDrive As Integer
  218. GLOBAL dCursor As Integer
  219. GLOBAL hwndSetup As Integer
  220. GLOBAL hwndApple As Integer
  221. GLOBAL OS_Windows95 As Integer
  222. GLOBAL bscrunged As Integer
  223. GLOBAL szErrorCode As String
  224. GLOBAL szReply As String
  225.  
  226. GLOBAL WinVer As Integer
  227. GLOBAL Ver As String
  228. GLOBAL szSystem32Path As String
  229.  
  230. GLOBAL  numcolours As Integer
  231. GLOBAL strnumcol As String
  232. GLOBAL btest As Integer
  233. GLOBAL i As Integer
  234.  
  235. ' This file needs the above globals etc for it's functions
  236. '$INCLUDE 'product.inc' 'Defines which change for every product
  237.  
  238. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  239. Sub InitCommonInstall() STATIC
  240. '    AddToBillboardList CUIDLL_FILENAME, DLG_MAILMAN, "MailmanDlgProc", 2500
  241.     AddToBillboardList "colors.dll", DLG_MAILMAN, "MailmanDlgProc", 25
  242.     numcolours=FIs256Colour()
  243. strnumcol=STR$(numcolours)
  244. 'dButton = DoMsgBox( strnumcol, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  245.     if numcolours<16 then  ' The 16 referes to the Bits per pixel and not 16 colours. That would be 8
  246. '        AddToBillboardList "Colors.dll", DLG_MAILMAN, "ColoursDlgProc", 25
  247.         AddToBillboardList "colors.dll", DLG_MAILMAN, "ColorsDlgProc", 25
  248.    endif
  249.     SetCopyGaugePosition -1, 150
  250. End Sub
  251.  
  252.  
  253. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  254. Function EndCommonInstall( AppReadmeFile$, InRoot%, szEditorExe$ ) STATIC AS INTEGER
  255.  
  256.     if RestartListEmpty = 0 or fSystemUpdated = 1 or bInstalledWin32s = 1 then
  257.         hDlg = DLG_DONEVIDEO
  258.     else
  259.         hDlg = DLG_DONENOVIDEO
  260.     end if
  261.  
  262. QuitLoop:
  263.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfoDlgProc", 0, "")
  264.     select case szButton
  265.     case "REACTIVATE"
  266.         goto QuitLoop
  267.     case "CONTINUE"     'Read me
  268.         if inRoot% = 1 then
  269.             szReadMe$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appReadmeFile$)
  270.         else
  271.             szReadMe$ = MakePath(szSrcBinPath, appReadmeFile$)
  272.         end if
  273.         if szEditorExe$ = "write.exe " then
  274.             run szEditorExe$ + szReadMe$, nowait
  275.         else
  276.             run szEditorExe$ + szReadMe$
  277.         end if
  278.         goto QuitLoop
  279.     case "BACK"     'Restart Windows
  280.         if HandleRestart = 0 then
  281.             dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  282.             EndCommonInstall = NAV_EXIT
  283.         else
  284.             EndCommonInstall = NAV_FORWARD
  285.         end if
  286.     case "EXIT" , "CANCEL"         'Return to Windows
  287.         if hDlg = DLG_DONEVIDEO then
  288.             dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  289.             EndCommonInstall = NAV_EXIT
  290.         else
  291.             EndCommonInstall = NAV_FORWARD
  292.         end if
  293.     end select
  294.  
  295.     UIPop 1
  296. End Function
  297.  
  298.  
  299. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  300. Sub Initialise(prodName$, defInstallPath$, msgCaption$) STATIC
  301.     ret% = Ctl3dRegister(HinstFrame())
  302.     ret% = Ctl3dAutoSubClass(HinstFrame())
  303.  
  304.     szMsgCaption$ = msgCaption$
  305.  
  306.     cursor% = ShowWaitCursor()
  307.  
  308.     ClearCopyList
  309.     szWinSysPath = ucase$(GetWindowsSysDir ())
  310.     szWinPath = ucase$(GetWindowsDir ())
  311.     dWinDrive = asc(mid$((szWinPath), 1,1)) - asc("A")+1
  312.     szWinDrive = mid$(szWinPath, 1,1)
  313.  
  314.     szSrcSetupPath = ucase$(GetSymbolValue ("STF_SRCDIR"))
  315.     szSrcBinPath = mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1) + SOURCE_BINARIES_SUBDIR
  316.     szDestPath = szWinDrive + ":" + defInstallPath$
  317.  
  318. '+++
  319. '$IFDEF WITH_FULL_SAMPLER
  320.     szFullSampPath = szWinDrive + ":" + "\DKMM\" + SAMPLER_PATH
  321. '$ENDIF
  322. '---
  323.  
  324.     SetTitle szMsgCaption$
  325.     SetBitmap CUIDLL_FILENAME, IDB_BITMAP
  326.     szCopyright = STR_COPYRIGHT + "     Setup " + STR_VERSION
  327.     SetAbout prodName$, szCopyright
  328.  
  329.     fPreviousMode = SetBeepingMode (1)
  330.     fPreviousMode = SetDecompMode (1)
  331.     fPreviousMode = SetSilentMode (0)
  332.  
  333.     szINFPath = ucase$(GetSymbolValue("STF_SRCINFPATH"))
  334.     if szINFPath = "" then
  335.         szINFPath = ucase$(GetSymbolValue("STF_CWDDIR")) + SETUP_INF_FILENAME
  336.     end if
  337.     ReadInfFile szINFPath
  338.  
  339.     szExpressCustomChoice = "EXPRESS"
  340.     szMinimalInstall = "OFF"
  341. '    szAddPMItem = "ON"
  342.  
  343.     fSystemUpdated = 0
  344.     bInstalledWin32s = 0
  345.  
  346.     ' Set up Application file names
  347.     APPLICATION_INI_FILE = APP_SHORTNAME + ".INI"
  348.     APPLICATION_EXE_FILE = APP_SHORTNAME + ".EXE"
  349.     APPLICATION_PENGE_FILE = APP_SHORTNAME + ".PNG"
  350.  
  351.     RestoreCursor(cursor%)
  352. End Sub
  353.  
  354.  
  355. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  356. Sub DeInitialise() STATIC
  357.     ret% = Ctl3dUnregister(HinstFrame())
  358. End Sub
  359.  
  360.  
  361. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  362. Sub AskQuit() STATIC
  363. begin:
  364.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_QUIT, "FQuitDlgProc", 0, "")
  365.     select case szButton
  366.     case "REACTIVATE"
  367.         goto begin
  368.     case "EXIT" , "CANCEL"
  369.         error STFQUIT
  370.     case "CONTINUE"
  371.         UIPop 1
  372.     end select
  373. End Sub
  374.  
  375.  
  376. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  377. Sub BadPath() STATIC
  378. begin:
  379.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_BADPATH, "FInfo0DlgProc", 0, "")
  380.     select case szButton
  381.     case "REACTIVATE"
  382.         goto begin
  383.     end select
  384.     UIPop 1
  385. End Sub
  386.  
  387.  
  388.  
  389. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  390. Sub NetworkDrive() STATIC
  391. begin:
  392.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_NETWORKDRIVE, "FInfo0DlgProc", 0, "")
  393.     select case szButton
  394.     case "REACTIVATE"
  395.         goto begin
  396.     end select
  397.     UIPop 1
  398. End Sub
  399.  
  400. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  401. Function LicenseAgreement() STATIC As Integer
  402. begin:
  403.     szButton = UIStartDlg( CUIDLL_FILENAME, DLG_LICENSE, "FInfoDlgProc", 0, "" )
  404.     select case szButton
  405.     case "CONTINUE"
  406.         UIPop 1
  407.         LicenseAgreement = NAV_FORWARD
  408.     case "EXIT" , "CANCEL"
  409.         LicenseAgreement = NAV_EXIT
  410.     end select
  411. End Function
  412.  
  413. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  414. Function Welcome() STATIC As Integer
  415. begin:
  416.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_WELCOME, "FInfoDlgProc", DLG_WELHELP, PROC_HELP)
  417.     select case szButton
  418.     case "REACTIVATE"
  419.         goto begin
  420.     case "CONTINUE"
  421.         UIPop 1
  422.         Welcome = NAV_FORWARD
  423.     case "EXIT" , "CANCEL"
  424.         AskQuit
  425.         goto begin
  426.     end select
  427. End Function
  428.  
  429. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  430. Function TestSystem() STATIC As Integer
  431.  
  432. TestNortonAntiVirus:
  433.     szWinString$ = GetIniKeyString( "win.ini", "windows", "load")
  434.     ret% = instr( szWinString,"NAV\navtsrw.exe" )
  435.     if ret% <> 0  then
  436.         dButton = DoMsgBox(STR_NAV, szMsgCaption$, MB_OK)
  437.     endif
  438.  
  439. TestWinVer:
  440.     if GetWindowsMajorVersion() < 3 or (GetWindowsMajorVersion() = 3 and GetWindowsMinorVersion() < 10) then
  441.         TestWinVerDlgLoop:
  442.             szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NEED31, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  443.             select case szButton
  444.             case "EXIT" , "CANCEL"
  445.                 goto TestWinVerDlgLoop
  446.             end select
  447.     end if
  448.  
  449.     ' Check for Win 95
  450.     OS_Windows95 = 0
  451.  
  452.     WinVer=GetWindowsMajorVersion * 100 + GetWindowsMinorVersion
  453.     Ver$=str$(WinVer)
  454. '        dButton = DoMsgBox(ver$, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  455.     if ((GetWindowsMajorVersion * 100 + GetWindowsMinorVersion) > 350) THEN
  456.         OS_Windows95 = 1
  457. '****************************************************************************************************************************************
  458. '****************************************************************************************************************************************
  459. 'For debugging...
  460. '        dButton = DoMsgBox("This is windows 95", szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  461. '****************************************************************************************************************************************
  462. '****************************************************************************************************************************************
  463.     endif
  464.  
  465.      IF OnWindowsNT () THEN
  466.         if ((GetWindowsMajorVersion * 100 + GetWindowsMinorVersion) > 309) THEN
  467.             OS_Windows95 = 1
  468. '****************************************************************************************************************************************
  469. '****************************************************************************************************************************************
  470. 'For debugging...
  471. '        dButton = DoMsgBox("This is windows 95", szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  472. '****************************************************************************************************************************************
  473. '****************************************************************************************************************************************
  474.         endif
  475.     endif
  476.  
  477. TestVGA:
  478.     if GetScreenWidth () < 640 or GetScreenHeight () < 480 then
  479.         TestVGADlgLoop:
  480.             szButton = UIStartDlg (CUIDLL_FILENAME, DLG_BADVGA, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  481.             select case szButton
  482.             case "REACTIVATE"
  483.                 goto TestVGADlgLoop
  484.             case "BACK"
  485.                 UIPop 1
  486.                 TestSystem = NAV_BACK
  487.                 goto back
  488.             case "CONTINUE"
  489.                 TestSystem = NAV_FORWARD
  490.                 UIPop 1
  491.                 goto TestMouse
  492.             case "EXIT" , "CANCEL"
  493.                 AskQuit
  494.                 goto TestVGADlgLoop
  495.             end select
  496.         end if
  497.  
  498. TestMouse:
  499.     if HasMouseInstalled() = false then
  500.     TestMouseDlgLoop:
  501.         szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NOMOUSE, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  502.         select case szButton
  503.         case "REACTIVATE"
  504.             goto TestMouseDlgLoop
  505.         case "BACK"
  506.             UIPop 1
  507.             TestSystem = NAV_BACK
  508.         case "CONTINUE"
  509.             TestSystem = NAV_FORWARD
  510.             UIPop 1
  511.             goto TestColour
  512.         case "EXIT" , "CANCEL"
  513.             AskQuit
  514.             goto TestMouseDlgLoop
  515.         end select
  516.     end if
  517.  
  518. TestColour:
  519.     if FIs256Colour() < 8 then  ' The 8 refers to the number of Bits per pixel...
  520.     TestColourDlgLoop:
  521.         szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NOT256, "FInfoDlgProc", DLG_POORMACHINE, PROC_HELP)
  522.         select case szButton
  523.         case "REACTIVATE"
  524.             goto TestColourDlgLoop
  525.         case "BACK"
  526.             UIPop 1
  527.             TestSystem = NAV_BACK
  528.             goto back
  529.         case "CONTINUE"
  530.             UIPop 1
  531.             TestSystem = NAV_FORWARD
  532.         case "EXIT" , "CANCEL"
  533.             AskQuit
  534.             goto TestColourDlgLoop
  535.         end select
  536.     end if
  537.  
  538. back:
  539. End Function
  540.  
  541.  
  542. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  543. '**
  544. '** Purpose:
  545. '**     Appends a file name to the end of a directory path,
  546. '**     inserting a backslash character as needed.
  547. '** Arguments:
  548. '**     szDir$  - full directory path (with optional ending "\")
  549. '**     szFile$ - filename to append to directory
  550. '** Returns:
  551. '**     Resulting fully qualified path name.
  552. '*************************************************************************
  553. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  554.     IF szDir$ = "" THEN
  555.         MakePath = szFile$
  556.     ELSEIF szFile$ = "" THEN
  557.         MakePath = szDir$
  558.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  559.         MakePath = szDir$ + szFile$
  560.     ELSE
  561.         MakePath = szDir$ + "\" + szFile$
  562.     END IF
  563. END FUNCTION
  564.  
  565.  
  566.  
  567. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  568. Function HandleRestart() STATIC AS INTEGER
  569.     ' Check there are system files to install AND check if Windows v3.1 or greater
  570.     if RestartListEmpty = 0 and GetWindowsMajorVersion >= 3 and GetWindowsMajorVersion >= 1 then
  571.         dButton = DoMsgBox(STR_EXIT, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  572.         tryagain:
  573.         if ExitExecRestart = 1 then
  574.             ' Exit failed
  575.             dButton = DoMsgBox(STR_EXITFAIL, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONSTOP)
  576.             goto tryagain
  577.         end if
  578.     end if
  579.  
  580.     HandleRestart = 1
  581.  
  582.     if RestartListEmpty = 1 then ' Empty, but we have to reboot
  583.         dummy% = ExitWindowsExec(MakePath(szDestPath, "_msrstrt.exe"), "")
  584.         if dummy% = 0 then
  585.             HandleRestart = 0
  586.         end if
  587.     end if
  588.  
  589. End Function
  590.  
  591. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  592. 'Sub UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  593. 'Dim szReadmeTitle As String
  594. 'Dim szInf As String
  595. '
  596. '    if onCDROM% = 1 then    'sampler
  597. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  598. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  599. '        szReadmeTitle = prodName$ + " " + readmeStr$
  600. '
  601. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  602. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  603. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  604. '    else
  605. '        if szAddPMItem = "ON" then
  606. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  607. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  608. '            szReadmeTitle = prodName$ + " " + readmeStr$
  609. '            if szMinimalInstall = "ON" then
  610. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  611. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  612. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  613. '            else
  614. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  615. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  616. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  617. '            end if
  618. '        end if
  619. '    end if
  620. '
  621. 'End Sub
  622.  
  623.  
  624. ''''''''''''''''''''''''''''''''''''''''''''
  625.  
  626. '' Alternative function for french stowaway
  627. '' Readme icon has shortened name
  628. 'Sub UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  629. 'Dim szReadmeTitle As String
  630. 'Dim szInf As String
  631. '
  632. '    if onCDROM% = 1 then    'sampler
  633. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  634. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  635. '        szReadmeTitle = readmeName$ + " " + readmeStr$
  636. '
  637. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  638. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  639. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  640. '   else
  641. '        if szAddPMItem = "ON" then
  642. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  643. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  644. '            szReadmeTitle = readmeName$ + " " + readmeStr$
  645. '            if szMinimalInstall = "ON" then
  646. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  647. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  648. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  649. '            else
  650. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  651. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  652. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  653. '            end if
  654. '        end if
  655. '    end if
  656. '
  657. 'End Sub
  658.  
  659.  
  660.  
  661. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  662. Function GetDiskSpaceNeeded( drive% ) STATIC As Long
  663. Dim dDummy As Long
  664.  
  665.     cursor% = ShowWaitCursor()
  666.  
  667.     SetSymbolValue "ExtraSpace", ""
  668.     SetSymbolValue "Needed", ""
  669.     SetSymbolValue "Cost", ""
  670.  
  671.     'Drives A - Z
  672.     for i% = 1 to 26
  673.         AddListItem "ExtraSpace", ""
  674.     next i%
  675.  
  676.     ReplaceListItem "ExtraSpace", dWinDrive, str$(MINIMUM_DISK_SPACE)    '2K for the INI file
  677.  
  678.     dDummy = GetCopyListCost("ExtraSpace","Needed","Cost")
  679.  
  680.     GetDiskSpaceNeeded = val(GetListItem ("Needed", drive))
  681.  
  682.     RemoveSymbol "Needed"
  683.     RemoveSymbol "Cost"
  684.     RemoveSymbol "ExtraSpace"
  685.  
  686.     RestoreCursor(cursor%)
  687. End Function
  688.  
  689.  
  690.  
  691. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  692. Sub UpdateIndeoAVIDrivers() STATIC
  693. Dim szWMDriver As String
  694. Dim szACMDriver As String
  695.  
  696.  
  697.     ' Dont update VFW on Win 95. It is already there.
  698.     IF OS_Windows95 = 0 then
  699.  
  700.         szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  701.  
  702.         if not(szWMDriver = "msacm.drv") then
  703.             fSystemUpdated = 1
  704.         end if
  705.  
  706.  
  707.         if VflatdPresent() = 0 then
  708.             CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  709.             fSystemUpdated = 1
  710.         end if
  711.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  712.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  713.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  714.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  715.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  716.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  717.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  718.         CreateIniKeyValue szWinPath + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  719.         CreateIniKeyValue szWinPath + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  720.         CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  721.  
  722.     END IF
  723.  
  724. End Sub
  725.  
  726. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  727. Sub UpdateWinGDrivers() STATIC
  728. Dim szDest As String
  729. Dim szDest1 As String
  730. Dim szDest2 As String
  731.  
  732.     ' only use DVA on Windows 3.x
  733.     if OnWin3x() = 1 then
  734.         AddSectionFilesToCopyList "dva", szSrcBinPath, szWinSysPath
  735.         if VflatdPresent() = 0 then
  736.             ' Taken out the path in the following device=dva.386 system.ini entry
  737.             CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  738.             fSystemUpdated = 1
  739.         end if
  740.     end if
  741.  
  742.     szDest = GetRealWindowsSysDir
  743.     szDest1 = MakePath(szDest,"wing32.dll")
  744.     szDest2 = MakePath(szDest,"wing32.xxx")
  745.     RenameFilePlease szDest1, szDest2
  746.  
  747.     UpdateWinG32 GetRealWindowsSysDir()
  748. End Sub
  749.  
  750. '''''''''''''''''''''''''''''''''''''''''''''''''
  751.  
  752. FUNCTION GetRealWindowsSysDir STATIC AS STRING
  753.     szBuf$ = string$(260, 32)
  754.     cbBuf% = GetRealSystemDir(szBuf$, 260)
  755.     IF cbBuf% = 0 THEN
  756.         ERROR STFERR
  757.     ELSE
  758.         IF cbBuf% > 259 THEN
  759.             res% = DoMsgBox("Buffer Overflow", "MS-Setup Error", MB_ICONHAND+MB_OK)
  760.             ERROR STFERR
  761.         END IF
  762.         szBuf$ = RTRIM$(szBuf$)
  763.         IF MID$(szBuf$, 1, 1) = "\" THEN
  764.             szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  765.         ELSEIF MID$(szBuf$, 2, 1) <> ":" THEN
  766.             szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  767.         END IF
  768.         IF MID$(szBuf$, LEN(szBuf$), 1) <> "\" THEN
  769.             szBuf$ = szBuf$ + "\"
  770.         END IF
  771.         GetRealWindowsSysDir = szBuf$
  772.     END IF
  773.  
  774.     szBuf$ = ""
  775. END FUNCTION
  776.  
  777. '''''''''''''''''''''''''''''''''''''''''''''''''
  778.  
  779. SUB UpdateWinG32 (szOrig$) STATIC
  780.     '
  781.     ' Here we check the version ourselves of wing32.dll, since
  782.     ' we can't get version checking for Win32 apps from Win16
  783.     '
  784.     FileNew$ = MakePath(szOrig$, "wing32.dll")
  785.     FileOrig$ = MakePath(szOrig$, "wing32.xxx")
  786.     IF IsWin32FileNewer( FileOrig$, FileNew$ ) THEN
  787.     RemoveFile FileOrig$, cmoForce
  788.     ELSE
  789.         RemoveFile FileNew$, cmoForce       ' get rid of new file
  790.     RenameFilePlease FileOrig$,FileNew$ ' put back old file
  791.     END IF
  792. END SUB
  793.  
  794. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  795. Function UpdateADPCMDrivers() STATIC As Integer
  796. Dim szWMDriver As String
  797. Dim szACMDriver As String
  798. Dim fUpdate As Integer
  799.  
  800.     '   Dont update ADPCM on Win 95. It is already there.
  801.     If OS_Windows95 = 0 then
  802.  
  803.     ' Check WaveMapper driver
  804.     szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  805.     szACMDriver = GetIniKeyString (MakePath(szWinPath, "system.ini"), "MSACM", "Install")
  806.  
  807.     if not(szWMDriver = "msacm.drv") then
  808.     ' Isn't installed so...
  809.  
  810.         ' If NO ADPCM drivers are installed so...
  811.         if (szWMDriver = "") then
  812.             ' Display a dialog saying "there are no ADPCM drivers on your system..."
  813.             fUpdate = 1
  814.         else
  815.             ' There is a different adpcm driver in there so warn about compatibility
  816.         loop1:
  817.             szButton = UIStartDlg(CUIDLL_FILENAME, DLG_URKADPCM, "FInfoDlgProc", DLG_ADPCMHELP, PROC_HELP)
  818.             select case szButton
  819.             case "REACTIVATE"
  820.                 goto loop1
  821.             case "EXIT" , "CANCEL"
  822.                 AskQuit
  823.                 goto loop1
  824.             case "CONTINUE"     ' YES
  825.                 UpdateADPCMDrivers = NAV_FORWARD
  826.                 UIPop 1
  827.                 fUpdate = 1
  828. '            case "CANCEL"       ' NO
  829. '                UIPop 1
  830. '                fUpdate = 0
  831.             case "BACK"
  832.                 UIPop 1
  833.                 UpdateADPCMDrivers = NAV_BACK
  834.                 goto back
  835.             end select
  836.         end if
  837.  
  838.  
  839.         if fUpdate = 1 then
  840.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  841.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  842.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  843.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  844.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  845.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  846.  
  847.             szMsacmPriority1 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY1")
  848.             szMsacmPriority2 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY2")
  849.             szMsacmPriority3 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY3")
  850.  
  851.             if mid$( szMsacmPriority1, 1, 1 ) = "0" then
  852.                 szMsacmPriority1 = "1" + mid$( szMsacmPriority1, 2, len(szMsacmPriority1)-1 )
  853.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY1", szMsacmPriority1, cmoOverwrite
  854.             endif
  855.  
  856.             if mid$( szMsacmPriority2, 1, 1 ) = "0" then
  857.                 szMsacmPriority2 = "1" + mid$( szMsacmPriority2, 2, len(szMsacmPriority2)-1 )
  858.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY2", szMsacmPriority2, cmoOverwrite
  859.             endif
  860.  
  861.             if mid$( szMsacmPriority3, 1, 1 ) = "0" then
  862.                 szMsacmPriority3 = "1" + mid$( szMsacmPriority3, 2, len(szMsacmPriority3)-1 )
  863.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY3", szMsacmPriority3, cmoOverwrite
  864.             endif
  865.  
  866.             fSystemUpdated = 1
  867.         else
  868.         noSysSoftware:
  869.             ' No install warning
  870.             szButton = UIStartDlg(CUIDLL_FILENAME, DLG_NOSYSSOFT, "FInfoDlgProc", 0, "")
  871.             select case szButton
  872.             case "REACTIVATE"
  873.                 goto noSysSoftware
  874.             case "EXIT" , "CANCEL"
  875.                 AskQuit
  876.                 goto noSysSoftware
  877.             case "CONTINUE"
  878.                 UIPop 1
  879.             case "BACK"
  880.                 UIPop 1
  881.                 goto loop1
  882.             end select
  883.         end if
  884.  
  885.     end if
  886. back:
  887.     END IF
  888. End Function
  889.  
  890. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  891. Function InstallQTW() STATIC As Integer
  892.  
  893. begin:
  894.     szButton = UIStartDlg( CUIDLL_FILENAME, DLG_INSTALLQTW, "FInfoDlgProc", 0, "" )
  895.     select case szButton
  896.     case "REACTIVATE"
  897.         goto begin
  898.     case "CONTINUE" ' Yes Install QTW
  899.         '
  900.         'Put in the New Dialogue here... (If you do not know what you are doing then can you please do as we say!!!)
  901.         dButton = DoMsgBox(STR_QTWMSG1+STR_QTWMSG2+STR_QTWMSG3, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  902.         '
  903.         IF OS_Windows95 = 1 then
  904.             ' Install the 32 bit version on Windows 95
  905. '***************************************************************************************************************************************
  906.             'Enter the code to disable the lip sync thing... 32 bit...
  907.             CreateIniKeyValue szWinPath + "Qtw.ini", "Sound 32", "DisableAutoRateAdjust", "1", cmoOverwrite
  908. '***************************************************************************************************************************************
  909. '            Run ( MakePath( szSrcBinPath, "qt32inst.exe" ) )
  910.             Run MakePath( szSrcBinPath, "qt32inst.exe" ),NOWAIT
  911.             ' Get the handle of the QTW installer
  912.             hwndApple = GetActiveWindow
  913. 'str=Str(hwndApple)
  914.             hwndApple = GetParent(hwndApple)
  915.             ' While this handle is still valid make it the active window... If not then continue installation
  916.             i = SetWindowPos(hwndApple, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE+SWP_NOMOVE)
  917.             ' Wait for QTW Install to Finish.
  918.             WHILE i = 1
  919.                 i = SetWindowPos(hwndApple, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE+SWP_NOMOVE)
  920.             WEND
  921.         Else
  922.             ' Else Install the 16 bit version
  923. '***************************************************************************************************************************************
  924.             'Enter the code to disable the lip sync thing... 16 bit...
  925.             CreateIniKeyValue szWinPath + "Qtw.ini", "Sound", "DisableAutoRateAdjust", "1", cmoOverwrite
  926. '***************************************************************************************************************************************
  927. '            Run ( MakePath( szSrcBinPath, "qt16inst.exe" ) )
  928. ' Display the QTW program until it has finished...
  929.             Run MakePath( szSrcBinPath, "qt16inst.exe" ),NOWAIT
  930.             ' Get the handle of the QTW installer
  931.             hwndApple = GetActiveWindow
  932.             ' Loop until the top most window is found
  933.             btest = hwndApple
  934.             WHILE not btest = 0
  935.                 hwndApple = btest
  936.                 btest = GetParent(hwndApple)
  937.             WEND
  938.  
  939.             ' While this handle is still valid make it the active window... If not then continue installation
  940.             ' Wait for QTW Install to Finish.
  941.             i=IsWindow(hwndApple)
  942.             btest=1
  943.             WHILE not i = 0
  944.                  ' Could not fins a function that would work properly!!!
  945.                  i = IsWindow(hwndApple)
  946.             WEND
  947.         END IF
  948.  
  949.         UIPop 1
  950.         InstallQTW = NAV_FORWARD
  951.  
  952.     case "BACK"     ' No Don't Install QTW
  953.         UIPop 1
  954.         InstallQTW = NAV_BACK
  955.     case "EXIT" , "CANCEL"
  956.         AskQuit
  957.         goto begin
  958.     end select
  959.  
  960. End Function
  961.  
  962. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''